<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.io.stream.DataStream</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.io.stream.DataStream");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327">tango.io.stream.DataStream</a></h1>
                
<b>License:</b><br>
BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a><br><br>
<b>Version:</b><br>
Initial release: Oct 2007<br><br>
<b>author:</b><br>Kris<br><br>
<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L35">DataInput</a></span>
<script>explorer.outline.addDecl('DataInput');</script> : InputFilter, Buffered;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">A simple way to read binary data from an arbitrary InputStream,
        such as a file:
        <pre class="d_code">

        <span class="k">auto</span> <span class="i">input</span> = <span class="k">new</span> <span class="i">DataInput</span> (<span class="k">new</span> <span class="i">FileInput</span>(<span class="sl">"path"</span>));
        <span class="k">auto</span> <span class="i">x</span> = <span class="i">input</span>.<span class="i">readInt</span>;
        <span class="k">auto</span> <span class="i">y</span> = <span class="i">input</span>.<span class="i">readDouble</span>;
        <span class="i">input</span>.<span class="i">read</span> (<span class="k">new</span> <span class="k">char</span>[<span class="n">10</span>]);
        <span class="i">input</span>.<span class="i">close</span>;
        
</pre></font><br><br>
<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L46">this</a></span>
<script>explorer.outline.addDecl('this');</script>(InputStream <span class="funcparam">stream</span>, uint <span class="funcparam">buffer</span> = uint.max, bool <span class="funcparam">flip</span> = false);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Propagate ctor to superclass</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>IBuffer <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L58">buffer</a></span>
<script>explorer.outline.addDecl('buffer');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Buffered interface</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>DataInput <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L69">clear</a></span>
<script>explorer.outline.addDecl('clear');</script>(); [override, final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Override this to give back a useful chaining reference</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L87">get</a></span>
<script>explorer.outline.addDecl('get');</script>(void[] <span class="funcparam">dst</span>); [override, final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Read an array back into a user-provided workspace. The
                space must be sufficiently large enough to house all of
                the array, and the actual number of bytes is returned.</font><br><br>
<font color="black">Note that the size of the array is written as an integer
                prefixing the array content itself.  Use read&#40;void[]&#41; to 
                eschew this prefix.<br><br></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L100">getBool</a></span>
<script>explorer.outline.addDecl('getBool');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>byte <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L111">getByte</a></span>
<script>explorer.outline.addDecl('getByte');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>short <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L122">getShort</a></span>
<script>explorer.outline.addDecl('getShort');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>int <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L135">getInt</a></span>
<script>explorer.outline.addDecl('getInt');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>long <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L148">getLong</a></span>
<script>explorer.outline.addDecl('getLong');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>float <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L161">getFloat</a></span>
<script>explorer.outline.addDecl('getFloat');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>double <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L174">getDouble</a></span>
<script>explorer.outline.addDecl('getDouble');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd></dl>
<script>explorer.outline.decSymbolLevel();</script></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L200">DataOutput</a></span>
<script>explorer.outline.addDecl('DataOutput');</script> : OutputFilter, Buffered;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">A simple way to write binary data to an arbitrary OutputStream,
        such as a file:
        <pre class="d_code">

        <span class="k">auto</span> <span class="i">output</span> = <span class="k">new</span> <span class="i">DataOutput</span> (<span class="k">new</span> <span class="i">FileOutput</span>(<span class="sl">"path"</span>));
        <span class="i">output</span>.<span class="i">writeInt</span> (<span class="n">1024</span>);
        <span class="i">output</span>.<span class="i">writeDouble</span> (<span class="n">3.14159</span>);
        <span class="i">output</span>.<span class="i">write</span> (<span class="sl">"hello world"</span>);
        <span class="i">output</span>.<span class="i">flush</span>.<span class="i">close</span>;
        
</pre></font><br><br>
<script>explorer.outline.incSymbolLevel();</script>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L211">this</a></span>
<script>explorer.outline.addDecl('this');</script>(OutputStream <span class="funcparam">stream</span>, uint <span class="funcparam">buffer</span> = uint.max, bool <span class="funcparam">flip</span> = false);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Propagate ctor to superclass</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>IBuffer <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L223">buffer</a></span>
<script>explorer.outline.addDecl('buffer');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Buffered interface</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L236">put</a></span>
<script>explorer.outline.addDecl('put');</script>(void[] <span class="funcparam">src</span>); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Write an array to the target stream. Note that the size 
                of the array is written as an integer prefixing the array 
                content itself. Use write&#40;void[]&#41; to eschew this prefix.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L248">putBool</a></span>
<script>explorer.outline.addDecl('putBool');</script>(bool <span class="funcparam">x</span>); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L257">putByte</a></span>
<script>explorer.outline.addDecl('putByte');</script>(byte <span class="funcparam">x</span>); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L266">putShort</a></span>
<script>explorer.outline.addDecl('putShort');</script>(short <span class="funcparam">x</span>); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L277">putInt</a></span>
<script>explorer.outline.addDecl('putInt');</script>(int <span class="funcparam">x</span>); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L288">putLong</a></span>
<script>explorer.outline.addDecl('putLong');</script>(long <span class="funcparam">x</span>); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L299">putFloat</a></span>
<script>explorer.outline.addDecl('putFloat');</script>(float <span class="funcparam">x</span>); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/stream/DataStream.d?rev=3327#L310">putDouble</a></span>
<script>explorer.outline.addDecl('putDouble');</script>(double <span class="funcparam">x</span>); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd></dl>
<script>explorer.outline.decSymbolLevel();</script></dd></dl>
<script>explorer.outline.decSymbolLevel();</script></td></tr>
                <tr><td id="docfooter">
                        Copyright (c) 2007 Kris Bell. All rights reserved :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Tue Mar  4 22:45:33 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>